//
// Created by huangjunhao on 2022/9/12.
// /**\
// *  08黄xx第一次上机文档
// * //顺序表，有效数组在数组中必须是连续的
// */

#include "SeqList.h"

//初始化
//void slInit(SL* ps);//, size_t capicity
//顺序表打印
//void slPrint(SL* ps);
//尾插尾删  头插头删  中间插入删除
//void slPushBack(SL* ps, SLDataType x);    //struct SeqList简写为SL
//void slPopBack(SL* ps);
//void slPushFront(SL* ps, SLDataType x);
//void slPopFront(SL* ps);
//在pos位置插入X  ,删除pos位置的值
//void SeqListInsert(SL* ps,int pos,SLDataType x);
//void SeqListErase(SL* ps,int pos);
//顺序表销毁
//void slDestory(SeqList* ps);
//检查空间，如果满了，进行扩容
//void checkCapicity(SeqList* ps);
//查找
//int slPrint(SL* ps, SLDataType x);

void slOutPrint(SeqList* ps){
    system("cls");
    //断言防止错误
    assert(ps);
    for(int i=0;i< ps->size;++i){
        printf("%d", ps->a[i]);
    }
}
void slInit(SeqList* ps){
    //malloc 分配内存  sizeof 返回变量或类型大小
    ps->a = malloc(sizeof(SLDataType)*4);
    if(ps->a == NULL){
        printf("申请内存失败\n");
        exit(-1);
    }
    ps->size = 0;
    ps->capicity = 4;
}
















